
import VueModal from './components/modal.vue'
import ShoppingModal from './components/shoppingModal.vue'
import InputNumber from './components/inputNumber.vue'
import TotalPrice from './components/totalPrice.vue'
import ProductImages from './components/productImages.vue'
import QrCode from 'v-qrcode'
import ProductSliderBar from './components/productSilderBar.vue'
import HomeCarousel from './components/homeCarousel.vue'
import MobileProduct from './components/mobileProduct.vue'

import Util from './util'

require('./app')({
  'shoppingModal': ShoppingModal,
  'inputNumber': InputNumber,
  'totalPrice': TotalPrice,
  'vueModal': VueModal,
  'qrcode': QrCode,
  'shoppingModal': ShoppingModal,
  'productImages': ProductImages,
  'productSliderBar': ProductSliderBar,
  'homeCarousel': HomeCarousel,
  'mobileProduct': MobileProduct
}, function(){
  Util.load_jiathis()

  $('#shuaixuan-panel-close-btn, .category-li').bind('click', function() {
    console.log('触发成功')
    $('.shuaixuan-panel').hide()
  })
  $('#shuaixuan-btn').bind('click', function() {
    console.log('触发成功')
    $('.shuaixuan-panel').show()
  })
}, {}, {}, {
  changeCategory(parentId, e) {
    var oldIndex = $(e.currentTarget).data('index')
    $(e.currentTarget).parents('.list-ul').find(".parent-category").removeClass('active').end().end().parent().addClass('active')
    $('.son-category').hide()
    $("#parent-category-"+parentId).show()
    return false
  },
  goToReserve() {
    window.location.href="/reserves/new"
    return false
  },
  }
)
